package model;

public class Edge {
	private  int from;
	private  int to;
	private  int cost;

	/**
	 * Creates a new Edge object
	 * @see Edge#Edge(int, int, int)
	 */
	public Edge() {
	}
	/**
	 * Creates a new Edge object
	 * defaulting the cost to 0.
	 * @see Edge#Edge(int, int, int)
	 */
	public Edge(int f, int t) {
		this(f, t, 0);
	}

	public Edge revert() {
		return new Edge(getTo(), getFrom(), getCost());
	}

	@Override
	public String toString() {
		String s = "Edge("+getFrom()+","+getTo()+","+getCost()+")";
		return s;
	}

	/**
	 * Creates a new Edge object
	 * @param f the starting Node
	 * @param t the ending Node
	 * @param c the cost of the Edge
	 */
	public Edge(int f, int t, int c) {
		setFrom(f);
		setTo(t);
		setCost(c);
	}

	public int getFrom() {
		return from;
	}

	public void setFrom(int f) {
		from = f;
	}

	public int getTo() {
		return to;
	}

	public void setTo(int t) {
		to = t;
	}

	public int getCost() {
		return cost;
	}

	public void setCost(int c) {
		cost = c;
	}
}
